#Check if a specific library is installed
#Take openpyxl , pandas and psutil as examples

import os


try:
    import pipenv
except ModuleNotFoundError:
    print('For the first time, install the pipenv library now.')
    os.system('pip install pipenv -i http://pypi.douban.com/simple --trusted-host pypi.douban.com')

try:
    import pyinstaller
except ModuleNotFoundError:
    print('For the first time, install the pyinstaller library now.')
    os.system('pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyinstaller')

try:
    import openpyxl
except ModuleNotFoundError:
    print('For the first time, install the openpyxl library now.')
    os.system('pip install -i https://pypi.douban.com/simple openpyxl')

try:
    import pandas
except ModuleNotFoundError:
    print('For the first time, install pandas library now.')
    os.system('pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas')

try:
    import psutil
except ModuleNotFoundError:
    print('For the first time, install psutil library now.')
    os.system('pip install psutil')

#If you are lucky, you will be loaded successfully！